|
|
|
|
|
|
|
When the user clicks a new tab, you need to make one frame invisible and the others invisible. In the Click event for the TabStrip control, you need to write the code that does this. First, you check to see whether the tab clicked is the current one. You do this by checking the Visible property of the current frame, as specified by the tabEmployee.SelectedItem.Index property: |
|
|
|
 |
|
|
|
|
Private Sub tabEmployee_Click()
Dim intIndex As Integer
intIndex = tabEmployee.SelectedItem.Index
If Not fraEmp(intndex).Visible Then
fraEmp(1).Visible = False
fraEmp(2).Visible = False
fraEmp(3).Visible = False
fraEmp(intIndex).Visible = True
End If
End Sub |
|
|
|
|
|
|
|
|
After youve made all the frames invisible, you set the Visible property of the clicked tab to True. If you have a lot of tabs, you might want to write a loop instead of listing each of the frames individually. |
|
|
|
 |
|
|
|
|
TIP When youre laying out all these frame controls on top of each other, they can get kind of difficult to work with. If you right-click the topmost frame control, you can select the Send To Back menu item on the pop-up menu to send this frame behind the other frames on the tab. This will help you move among the different frames more easily. |
|
|
|
|
|
|
|
|
This control is easier to use at design time than the TabStrip control, because it allows you to place controls on each tab. In other words, instead of having to create container controls, you can just move from tab to tab placing controls on each at design time. An example of the SSTab control is shown in Figure 31.7. |
|
|
|
|
|
|
|
|
Examples Filename: SSTab.frm |
|
|
|
|
|